package com.leyou.item.api;

import com.leyou.item.pojo.Category;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description: 商品分类相关Api
 * @author 朱正磊
 * @date 2021-04-08 13:39:54
 */
@Component
@FeignClient("item-service")
@RequestMapping("category")
public interface CategoryApi {

    /**
     * description: 根据父节点id查询商品分类
     * @author 朱正磊
     * @date 2021-03-26 19:10:14
     * @param pid 父节点id
     * @return 返回商品分类集合
     */
    @GetMapping("list")
    List<Category> queryCategoryListByPid(@RequestParam("pid") Long pid);

    /**
     * description: 根据多个商品分类id查询商品分类集合
     * @author 朱正磊
     * @date 2021-04-06 23:06:12
     * @param ids 商品分类id集合
     * @return 返回商品分类集合
     */
    @GetMapping("list/ids")
    List<Category> queryByIds(@RequestParam("ids") List<Long> ids);

}
